<template>
	<view>
		<page-header :headInfo="headInfo"></page-header>
		<view class="listStyle">
			<view @tap="openCode">
				<view>赞赏Ta</view>
				<view class="iconfont icon-you"></view>
			</view>
		
			<view>
				<view>关于</view>
				<view>v1.0.0</view>
			</view>
		</view>
		<view class="layOutBtn" @tap="layOut">退出登录</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				headInfo: {
					type: 1,
					title: '设置'
				}
			}
		},
		onLoad() {
		},
		methods: {
			/**
			 * @author smallfour
			 * @description 打开赞赏码
			 */
			openCode:function(){
				let imageArr = ['http://www.fourleafclover.club/image/admireCode.jpg']
				uni.previewImage({
					urls: imageArr,
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
						success: function(data) {
							// console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
						},
						fail: function(err) {
							console.log(err.errMsg);
						}
					}
				});
			},
			
			/**
			 * @author smallfour
			 * @description 退出登录
			 */
			layOut:function(){
				uni.showModal({
					content: '确定要退出登录吗',
					success: function (res) {
						if (res.confirm) {
							uni.clearStorage();
							uni.reLaunch({
								url:'/pages/login/login'
							})
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	.listStyle>view{
		display: flex;
		padding: 0 30rpx;
		height: 96rpx;
		line-height: 96rpx;
		view:nth-child(2){
			text-align: right;
		}
	}
	.listStyle>view>view{
		flex:1;
	}
	
	.layOutBtn{
		width:560rpx;
		text-align: center;
		height: 80rpx;
		line-height: 80rpx;
		background: #f0f0f0;
		color: #ef6784;
		border-radius: 60rpx;
		position: absolute;
		bottom: 200rpx;
		left: calc(50% - 280rpx);
	}
</style>
